<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<script type="text/javascript">
<!--
function exp(id){
	var action = "${ctx}/crm/order!pdf.action?id="+id;
	window.open(action);
	return false;
}
//-->
</script>
<form id="pagerForm" method="post" action="${ctx }/crm/order.action">
	<input type="hidden" name="status" value="${param.status}">
	<input type="hidden" name="keywords" value="${param.keywords}" />
	<input type="hidden" name="pageNum"  value="${page.pageNo}" />
	<input type="hidden" name="numPerPage" id="numPerPage" value="${page.pageSize}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
	
	<input type="hidden" name="page.pageNo" id="pageNo" value="${page.pageNo}"/>
	<input type="hidden" name="page.orderBy" id="orderBy" value="${page.orderBy}"/>
	<input type="hidden" name="page.order" id="order" value="${page.order}"/>
	<input type="hidden" name="page.pageSize" id="pageSize" value="${page.pageSize}"/>
</form>

<div class="page">
	<div class="pageHeader">
		<form onsubmit="return navTabSearch(this);" action="${ctx }/crm/order.action" method="post">
		<div class="searchBar">
			<ul class="searchContent">
				<li>
					<label>客户姓名：</label>
					<input type="text" name="filter_LIKES_customer" value="${param['filter_LIKES_customer']}"/>
				</li>
				<li>
					<label>下单时间：</label>
					<input type="text" name="filter_GED_orderdate" id="filter_GED_orderdate" value="${param['filter_GED_orderdate']}" size="8" onfocus="WdatePicker({el:'filter_GED_orderdate',dateFmt:'yyyy-MM-dd'})"/> 至
					<input type="text" name="filter_LED_orderdate" id="filter_LED_orderdate" value="${param['filter_LED_orderdate']}" size="8" onfocus="WdatePicker({el:'filter_LED_orderdate',dateFmt:'yyyy-MM-dd'})"/>
				</li>
				<li>
					<label>订单编号：</label>
					<input type="text" name="filter_LIKES_code" value="${param['filter_LIKES_code']}"/>
				</li>
			</ul>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit"> 检 索 </button></div></div></li>
					<li><a class="button" href="${ctx }/crm/orderSearch.action?navTab=orderList&action=order" target="dialog" rel="dlg_page1" title="查询框"><span>高级检索</span></a></li>
				</ul>
			</div>
		</div>
		</form>
	</div>
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<security:authorize ifAllGranted="ROLE_新增订单">
				<li><a class="add" href="${ctx }/crm/order!input.action" target="navTab" rel="orderAdd"><span>新增</span></a></li>
				</security:authorize>
				<security:authorize ifAllGranted="ROLE_删除订单">
				<li><a  class="delete" href="${ctx}/crm/order!delete.action?id={orderId}" target="navTabTodo" title="确定要删除吗?" ><span>删除</span></a></li>
				</security:authorize>
				<security:authorize ifAllGranted="ROLE_修改订单">
				<li><a  class="edit" href="${ctx}/crm/order!input.action?id={orderId}" rel="orderEdit"  target="navTab" title="修改订单" ><span>修改</span></a></li>
				</security:authorize>
				<li class="line">line</li>
				<security:authorize ifAllGranted="ROLE_打印订单">
				<li><a  class="edit" href="${ctx}/crm/order!print.action?id={orderId}" target="navTab"><span>打印</span></a></li>
				</security:authorize>
				<security:authorize ifAllGranted="ROLE_导出订单">
				<li><a  class="edit" href="javascript:void(0);" fun="exp({orderId})" target="navTab"><span>导出</span></a></li>
				</security:authorize>
				<li class="line">line</li>
				<security:authorize ifAllGranted="ROLE_查看订单">
				<li><a  class="edit" href="${ctx}/crm/order!ordercheck.action?act=order&id={orderId}" target="navTab" ><span>查看</span></a></li>
				</security:authorize>
				<li class="line">line</li>
			</ul>
		</div>
		<table class="table" layouth="142">
			<thead>
				<tr>
				<th>下单时间</th>
				<th>下单人</th>
				<th>订单编号</th>
				<th>客户姓名</th>
				<th>商品种类</th>
				<th>订单金额</th>
				<th>订单状态</th>
				<th>确认人</th>
				<th>发票号码</th>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="page.result">
					<tr target="orderId" rel="${id}">
						<td><s:date name="orderdate" format="yyyy-MM-dd HH:mm:ss"/></td>
						<td>${maker }</td>
						<td>${code }</td>
						<td>${customer }</td>
						<td><s:property value="detail.size"/></td>
						<td><s:if test="totalcash!=null"><s:text name="global.format.money"><s:param value="totalcash"/></s:text></s:if></td>
						<td><s:if test="statusid==2">未收款</s:if><s:else>已收款</s:else></td>
						<td>${confirm }</td>
						<td>${recordno }</td>
					</tr>
		</s:iterator>	
			</tbody>
		</table>
		<div class="panelBar">
			<div class="pages">
				<span>显示</span>
				<select name="numPerPage" id="showNumPerPage" onchange="$('#pageSize').val($(this).val());navTabPageBreak({numPerPage:this.value})">
					<option value="14">14</option>
					<option value="20">20</option>
					<option value="50">50</option>
					<option value="100">100</option>
				</select>
				<span>条，共${page.totalCount}条</span>
			</div>
			
			<div class="pagination" targetType="navTab" totalCount="${page.totalCount}" numPerPage="${page.pageSize}" pageNumShown="10" currentPage="${page.pageNo}"></div>

		</div>
	</div>
</div>